/**************************************************************************
** File name:
** Create: 
**   Keith
**   2012-11-20
** Modify:
**
** Description:
**
**************************************************************************/

#ifndef UPDATOR_H
#define UPDATOR_H

#include <QtNetwork>
#include <QString>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QUrl>
#include <QFile>
#include <QObject>
#include <QThread>
#include <QLabel>

class Updator : public QThread
{
    Q_OBJECT

public:
    Updator(QString configUrl, QLabel *label);
    ~Updator();

    void run();

private:
    void startRequest(QUrl url, QString filePath);

signals:
    void getInfoFinished();

private slots:
    void httpFinished();
    void httpReadyRead();

private:
    QNetworkAccessManager *qnam;
    QNetworkReply *reply;
    QFile *file;
    QString errInfo;
    QLabel *label;
    QString configUrl;
};

#endif // UPDATOR_H
